<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改学生请假申请')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-apply-edit" th:object="${applyList}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">学生姓名：</label>
                <div class="col-sm-8">
                    <input name="studentId"  type="hidden"  th:field="*{studentId}">
                    <input name="studentName" class="form-control" type="text" readonly th:field="*{studentName}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">年级名称：</label>
                <div class="col-sm-8">
                    <input name="gradeId"  type="hidden"  th:field="*{gradeId}">
                    <input name="gradeName" class="form-control" type="text" readonly th:field="*{gradeName}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">班级名称：</label>
                <div class="col-sm-8">
                    <input name="classId"  type="hidden"  th:field="*{classId}">
                    <input name="className" class="form-control" type="text" readonly th:field="*{className}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">申请类型：</label>
                <div class="col-sm-8">
                    <select name="type" th:with="type=${@dict.getType('sc_apply_type')}" required class="form-control" th:field="*{type}">
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="beginTime" th:value="${#dates.format(applyList.beginTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="endTime" th:value="${#dates.format(applyList.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">原因：</label>
                <div class="col-sm-8">
                    <textarea name="reason" th:field="*{reason}" class="form-control" type="text"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "student/apply";
        $("#form-apply-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-apply-edit').serialize());
            }
        }

        $("input[name='beginTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>